package kr.couponplay.android.activity.deal.menu;

import kr.couponplay.android.AppContext;
import kr.couponplay.android.activity.deal.DealListActivity;
import kr.couponplay.android.activity.deal.category.CategoryHelper;
import android.annotation.SuppressLint;
import android.view.View;
import android.view.View.OnClickListener;

@SuppressLint("HandlerLeak") 
public class TopMenuButtonOnClickListener implements OnClickListener {
	private DealListActivity activity;
	
	public TopMenuButtonOnClickListener(DealListActivity activity) {
		this.activity = activity;
	}
	
	@Override
	public void onClick(View view) {
		TopMenuHelper.selectTopMenuButton(view);
		SubMenuHelper.selectSubMenuButton(0);
		SubMenuHelper.setCategorySubMenuText("전체");
		CategoryHelper.subCategoryId = 0;
		CategoryHelper.draw(TopMenuHelper.selectedTopMenuButtonIndex);
    	AppContext.isClearCategoryDeals = true;
    	AppContext.isClearNewDeals = true;
    	AppContext.isClearEndDeals = true;
    	AppContext.isClearFreeDeals = true;
		activity.getDealList();
	}
}
